package com.weirong.smartvault.backservice.util.statistics;

import java.util.ArrayList;
import java.util.List;

/**
 * 于2017/12/21由 KFEB4 创建 .
 */
public class Protocol {
    static final String DELIMITER = ",";
    public static String trans(Object ...args){
        List<String> res = new ArrayList<>();
        for (Object obj :args) {
            res.add(obj.toString());
        }
        return String.join(DELIMITER, res);
    }
    public static StatisticsType getType(String key){
        String[] items = key.split(DELIMITER);
        return StatisticsType.getByValue(Integer.valueOf(items[0]));
    }
}
